<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script src="jquery/jquery1.9/jquery-1.9.0.js"></script>
    <script>
        $(function(){
            $("input:eq(0)").click(function(){
				//div元素具有hello属性
               $("div[hello]").css("background","red");
            });
            $("input:eq(1)").click(function(){
				$("p[hello=itany]").css("background","green");
				
            });
            $("input:eq(2)").click(function(){
				$("p[hello!=itany]").css("background","green");
            });
            $("input:eq(3)").click(function(){
				$("p[id^=h]").css("background","purple");
            });
            $("input:eq(4)").click(function(){
				$("p[id$=lo]").css("background","purple");
            });
			$("input:eq(5)").click(function(){
				$("p[id*=ei]").css("background","yellow");
            });
			$("input:eq(6)").click(function(){
				$("p[id][hello^=wbs][class*=an]").css("background","purple");
            });
        });
    </script>
</head>
<body>
    <input type="button" value="选择包含hello属性的div元素" id="btn1">
	<input type="button" value="选择hello属性值等于itany的p元素" id="btn2">
	<input type="button" value="选择hello属性值不等于itany的p元素" id="btn3">
	<input type="button" value="选择id属性值以h开头的p元素" id="btn4">
	<input type="button" value="选择id属性值以lo结尾的p元素" id="btn5">
	<input type="button" value="选择id属性值包含ei的p元素" id="btn6">
	<input type="button" value="选择包含属性id，并且属性hello的值以wbs开头，并且属性class的值中包含an的p元素" id="btn7">
	<hr>

	<p>welcome to 网博</p>
	<div>
		<p id="hello">hello itany</p>
	</div>
	<div>
		<span id="hehe"></span>
		<p id="heihei" hello="wbs20062" class="itany">今天星期五，相当的开心</p>
	</div>
	<p id="world" xixi="hi">welcome to wbs20062</p>
	<p></p>
	<p hello="world">Hello World!</p>
	<p hello="itany">welcome to wbs20062</p>
	<div hello="welcome">happy wbs20062</div>
</body>
</html>